package core;

/**
 * 
 * @author Xiaohui
 * 
 */
public class TimeInterval {
	private int startTime;
	private int endTime;
	final int step = 1;

	public TimeInterval() {
		startTime = 1;
		endTime = 2;
	}

	public TimeInterval(double dtime) {
		this.startTime = (int) dtime;
		this.endTime = this.startTime + step;
	}

	public void next() {
		startTime += step;
		endTime += step;
	}

	/**
	 * @return the startTime
	 */
	public int getStartTime() {
		return startTime;
	}

	/**
	 * @return the endTime
	 */
	public int getEndTime() {
		return endTime;
	}

	public void set(double passingTime) {
		startTime = (int) passingTime;
		endTime = startTime + step;
	}

	public String toString() {
		return "<" + startTime + "-" + endTime + ">";

	}

}
